
#import "LLInitBaseViewTool.h"

@implementation LLInitBaseViewTool

#pragma mark - 创建label
+ (UILabel *)labelWithText:(NSString *)text textColor:(UIColor *)textColor font:(CGFloat)font textAlignment:(NSTextAlignment)textAlignment{
    UILabel *label = [UILabel new];
    label.text = text;
    label.textColor = textColor;
    label.font = LLRegularFont(font);
    label.textAlignment = textAlignment;
    return label;
}

#pragma mark - 创建button
+ (LLButton *)buttonWithTitle:(NSString *)title image:(NSString *)image titleColor:(UIColor *)titleColor font:(CGFloat)font {
    LLButton *button = [LLButton new];
    [button setTitle:title forState:0];
    [button setImage:[UIImage imageNamed:image] forState:0];
    [button setTitleColor:titleColor forState:0];
    button.titleLabel.font = LLRegularFont(font);
    button.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    return button;
}

#pragma mark - 创建shadow
+ (UIView *)shadowWithCornerRadius:(CGFloat)cornerRadius shadowColor:(UIColor *)shadowColor {
    UIView *shadow = [UIView new];
    shadow.backgroundColor = [UIColor whiteColor];
    shadow.layer.shadowOpacity = 0.5;
    shadow.layer.shadowOffset = CGSizeMake(-0.5,0.5);
    shadow.layer.shadowColor = shadowColor.CGColor;
    shadow.layer.cornerRadius = cornerRadius;
    return shadow;
}

#pragma mark - UITextField封装
+ (UITextField *)creatRouteTextField:(NSString *)title font:(CGFloat)font SubTitle:(NSString *)subtitle textColor:(UIColor *)textColor tintColor:(UIColor *)tintColor{
    UITextField *txt = [UITextField new];
    txt.text = title;
    txt.textAlignment = NSTextAlignmentLeft;
    txt.font = LLRegularFont(font);
    txt.returnKeyType = UIReturnKeyDone;
    txt.placeholder = subtitle;
    txt.textColor = textColor;
    txt.tintColor = tintColor;
    [txt setValue:LLColorRGB153 forKeyPath:@"_placeholderLabel.textColor"];
    return txt;
}

@end
